package Code.Day1_20240918.com.dx.day01;

import java.util.Scanner;

/**
 * @ClassName Test09
 * @Description 选择结构
 * @Author 12994
 * @Date 2024/9/18 20:49
 * @Version 1.0
 **/
public class Test09 {
    /**
     * if if-else if-else-if switch
     *
     * @param args
     */
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("输入您的分数(整数): ");
//        int score = input.nextInt();
        int score = 95;
        int _high = 175;
        if (score > 90) {
            System.out.println("奖励一台iPhone6S!");
        } else if (score >= 80) {
            System.out.println("优秀!");
            if (_high >= 170) {
                System.out.println("身高大于170!");
            }
        } else {
            System.out.println("其它!");
        }

        System.out.println("输入第二个数字: ");
        int score2 = input.nextInt();
        // final int goal = (int) (Math.random() * 10);
        switch (score2) {
            // case后的值只能使用编译期(且能正确通过编译的)常量, 不能使用运行期常量
            case 6:
                System.out.println("您中奖了！");
                break;
            case 2:
                System.out.println("2");
                break;
            default:
                System.out.println("default!");
                break;
        }
    }
}
